package com.hqyj.controller;


import com.hqyj.pojo.GoodsQueryParameter;
import com.hqyj.pojo.R;
import com.hqyj.service.GoodsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2023-02-27 10:43:26
 */
@RestController
@RequestMapping("/goods-info")
public class GoodsInfoController {

    @Autowired
    GoodsInfoService goodsInfoService;

    //查询特卖和热卖产品
    @GetMapping("/goods")
    public R queryGoodsByFormId(Integer formId){
        return goodsInfoService.queryGoodsByFormId(formId);
    }
    //查询商品分页
    @GetMapping("/goods/1")
    public R queryGoodsByParameter(GoodsQueryParameter g){
        return goodsInfoService.queryGoodsByParameter(g);
    }
    //查询商品类型的三个广告位数据
    @GetMapping("/goods/2")
    public R queryGoodsThree(Integer formId,Integer goodsTypeId){
        return goodsInfoService.queryGoodsThree(formId,goodsTypeId);
    }





}

